export default [{
  "label": "Tabs",
  "key": "tabs",
  "type": "tabs",
  "validateOn": "change",
  "components": [{
    "label": "链接配置",
    "key": "链接配置",
    "components": [{
      "label": "Host",
      "key": "host",
      "validateOn": "blur",
      "validate": {
        "required": true,
      },
      "type": "textfield",
      "input": true,
      "inputType": "text",
    }, {
      "label": "Port",
      "key": "port",
      "validateOn": "blur",
      "validate": {
        "required": true,
      },
      "type": "textfield",
      "input": true,
      "inputType": "text",
    }, {
      "label": "userName",
      "key": "userName",
      "validateOn": "blur",
      "validate": {
        "required": true,
      },
      "type": "textfield",
      "input": true,
      "inputType": "text"
    }, {
      "label": "password",
      "key": "password",
      "validateOn": "blur",
      "validate": {
        "required": true
      },
      "type": "textfield",
      "input": true,
      "inputType": "text"
    }, {
      "label": "dbName",
      "key": "dbName",
      "labelPosition": "top",
      "validateOn": "blur",
      "validate": {
        "required": true
      },
      "type": "textfield",
      "input": true,
      "inputType": "text"
    }, {
      "label": "建立链接",
      "action": "url",
      "key": "connect",
      "type": "button",
      "url": "http://api-ipaas.dev.clickpaas.com/cid-cnn-runtime-job/mysql/connection",
      "input": true,
      "theme": "primary"
    }]
  }, {
    "label": "入参配置",
    "key": "入参配置",
    "components": [{
      "label": "HTML",
      "className": "alert alert-warning",
      "content": "请先建立数据库链接",
      "key": "html",
      "customConditionalInput": [{
        "who": "connect",
        "when": 1,
        "eq": "true"
      }],
      "type": "htmlelement",
      "tag": "p",
    }, {
      "label": "操作",
      "key": "oporate",
      "labelPosition": "top",
      "validate": {
        "required": true
      },
      "validateOn": "blur",
      "customConditionalInput": [{
        "who": "connect",
        "when": 2,
        "eq": "true"
      }],
      "dataSrc": "values",
      "data": {
        "values": [{
          "label": "Select",
          "value": "select"
        }, {
          "label": "Update",
          "value": "update"
        }, {
          "label": "Insert",
          "value": "insert"
        }, {
          "label": "Delete",
          "value": "delete"
        }]
      },
      "idPath": "id",
      "type": "select",
      "dymicQuery": [{}]
    }, {
      "label": " 选择表",
      "key": "tableName",
      "labelPosition": "top",
      "isDymic": true,
      "validate": {
        "required": true
      },
      "validateOn": "blur",
      "customConditionalInput": [{
        "who": "oporate",
        "when": 1,
        "eq": ""
      }],
      "dataSrc": "url",
      "data": {
        "url": "/cid-cnn-runtime-job/mysql/db/tables"
      },
      "valueProperty": "tableName",
      "idPath": "id",
      "template": "<span>Table Name: {{ item.tableName }}</span>",
      "type": "select",
      "dymicQuery": [{
        "key": "host",
        "value": "host"
      }, {
        "key": "port",
        "value": "port"
      }, {
        "key": "userName",
        "value": "userName"
      }, {
        "key": "password",
        "value": "password"
      }, {
        "key": "dbName",
        "value": "dbName"
      }],
      "refreshOn": ["host", "port", "userName", "password", "dbName"]
    }, {
      "label": "选择查询列",
      "key": "columns",
      "labelPosition": "top",
      "isDymic": true,
      "validateOn": "blur",
      "customConditionalInput": [{
        "who": "oporate",
        "when": 7,
        "eq": "['select', 'delete', 'update']"
      }],
      "multiple": true,
      "dataSrc": "url",
      "data": {
        "url": "/cid-cnn-runtime-job/mysql/db/table/columns"
      },
      "valueProperty": "columnName",
      "idPath": "id",
      "template": "<span>{{ item.columnName }}</span>",
      "type": "select",
      "dymicQuery": [{
        "key": "host",
        "value": "host"
      }, {
        "key": "port",
        "value": "port"
      }, {
        "key": "userName",
        "value": "userName"
      }, {
        "key": "password",
        "value": "password"
      }, {
        "key": "dbName",
        "value": "dbName"
      }, {
        "key": "tableName",
        "value": "tableName"
      }],
      "selectValues": "data",
      "input": true,
      "refreshOn": ["host", "port", "userName", "password", "dbName", "tableName"],
      "clearOnRefresh": true
    }, {
      "label": "查询条件",
      "key": "parameter",
      "labelPosition": "top",
      "validateOn": "change",
      "customConditionalInput": [{
        "who": "oporate",
        "when": 7,
        "eq": "['select', 'delete', 'update']"
      }],
      "type": "datagrid",
      "dymicType": 1,
      "refreshOn": "columns",
      "defaultValue": [{
        "textField2": "",
        "textField3": ""
      }],
      "input": true,
      "components": [{
        "label": "操作",
        "key": "operator",
        "labelPosition": "top",
        "clearOnHide": true,
        "validateOn": "change",
        "type": "textfield",
        "input": true,
        "inputType": "text"
      }, {
        "label": "值",
        "key": "value",
        "labelPosition": "top",
        "clearOnHide": true,
        "validateOn": "change",
        "type": "textfield",
        "input": true,
        "inputType": "text"
      }]
    }, {
      "label": "出参字段",
      "key": "outKeys",
      "labelPosition": "top",
      "validateOn": "change",
      "customConditionalInput": [{
        "who": "oporate",
        "when": 2,
        "eq": "select"
      }],
      "dataSrc": "url",
      "data": {
        "url": "/cid-cnn-runtime-job/mysql/db/table/columns"
      },
      "template": "<span>{{ item.columnName }}</span>",
      "type": "select",
      "dymicQuery": [{
        "key": "host",
        "value": "host"
      }, {
        "key": "port",
        "value": "port"
      }, {
        "key": "userName",
        "value": "userName"
      }, {
        "key": "password",
        "value": "password"
      }, {
        "key": "dbName",
        "value": "dbName"
      }, {
        "key": "tableName",
        "value": "tableName"
      }],
      "selectValues": "data",
      "refreshOn": ["host", "port", "userName", "password", "dbName", "tableName"],
      "clearOnRefresh": true
    }, {
      "label": "选择更新列",
      "key": "updateColumnList",
      "labelPosition": "top",
      "isDymic": true,
      "customConditionalInput": [{
        "who": "oporate",
        "when": 2,
        "eq": "update"
      }],
      "dataSrc": "url",
      "data": {
        "url": "/cid-cnn-runtime-job/mysql/db/table/columns"
      },
      "valueProperty": "columnName",
      "template": "<span>{{ item.columnName }}</span>",
      "type": "select",
      "dymicQuery": [{
        "key": "host",
        "value": "host"
      }, {
        "key": "port",
        "value": "port"
      }, {
        "key": "userName",
        "value": "userName"
      }, {
        "key": "password",
        "value": "password"
      }, {
        "key": "dbName",
        "value": "dbName"
      }, {
        "key": "tableName",
        "value": "tableName"
      }],
      "selectValues": "data",
      "refreshOn": ["host", "port", "userName", "password", "dbName", "tableName"],
      "clearOnRefresh": true
    }, {
      "label": "更新字段",
      "key": "updateColumnValues",
      "labelPosition": "top",
      "isDymic": true,
      "validateOn": "change",
      "customConditionalInput": [{
        "who": "oporate",
        "when": 2,
        "eq": "update"
      }],
      "type": "datagrid",
      "dymicType": 1,
      "refreshOn": "updateColumnList",
      "input": true,
      "components": [{
        "label": "值",
        "key": "value",
        "type": "textfield",
        "input": true,
        "labelPosition": "top",
        "validateOn": "change",
        "inputType": "text"
      }],
    }, {
      "label": " 新增数据字段",
      "key": "insertColumnList",
      "labelPosition": "top",
      "validateOn": "blur",
      "customConditionalInput": [{
        "who": "oporate",
        "when": 2,
        "eq": "insert"
      }],
      "customConditional": "show = _.isEqual(data.oporate || '', 'insert')",
      "multiple": true,
      "dataSrc": "url",
      "data": {
        "url": "/cid-cnn-runtime-job/mysql/db/table/columns"
      },
      "valueProperty": "columnName",
      "template": "<span>{{ item.columnName }}</span>",
      "type": "select",
      "dymicQuery": [{
        "key": "host",
        "value": "host"
      }, {
        "key": "port",
        "value": "port"
      }, {
        "key": "userName",
        "value": "userName"
      }, {
        "key": "password",
        "value": "password"
      }, {
        "key": "dbName",
        "value": "dbName"
      }, {
        "key": "tableName",
        "value": "tableName"
      }],
      "input": true,
      "refreshOn": ["host", "port", "userName", "password", "dbName", "tableName"],
      "clearOnRefresh": true
    }, {
      "label": "新增字段值",
      "key": "updateColumns",
      "labelPosition": "top",
      "validateOn": "change",
      "customConditionalInput": [{
        "who": "oporate",
        "when": 2,
        "eq": "insert"
      }],
      "type": "datagrid",
      "dymicType": 1,
      "refreshOn": "insertColumnList",
      "input": true,
      "components": [{
        "label": "值",
        "key": "value",
        "type": "textfield",
        "input": true,
        "validateOn": "change"
      }]
    }, {
      "label": "确定",
      "key": "submit",
      "action": "event",
      "customConditionalInput": [{
        "who": "oporate",
        "when": 1,
        "eq": ""
      }],
      "type": "button",
      "event": "loadParams"
    }]
  }]
}]

